package com.ikas.ai.server.module.machine.controller;

import com.ikas.ai.handle.JsonResult;
import com.ikas.ai.server.module.AbstractBean;
import com.ikas.ai.server.module.machine.service.MachineInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 机组信息
 *
 * @author tang.xuandong
 * @version 1.0.0
 * @date 2023/5/9 16:50
 */
@RestController
@RequestMapping("/machine/info")
public class MachineInfoController extends AbstractBean {

    @Resource
    private MachineInfoService machineInfoService;

    /**
     * 通过机组编号获取机组运行时实时信息
     *
     * @param machineNo 机组编号
     * @return Json
     */
    @GetMapping("/getMachineRunTimeInfo")
    public JsonResult getMachineRunTimeInfo(@RequestParam(required = true) String machineNo) {
        return JsonResult.ok(machineInfoService.getMachineRunTimeInfo(machineNo));
    }

}
